home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Online / SpeakFreely / src / lpc10 / synths.c < prev    next >
C/C++ Source or Header  |  2000-05-18  |  1KB  |  57 lines

  1. /******************************************************************
  2. *
  3. *    SYNTHS Version 48
  4. *
  5. ******************************************************************
  6. *
  7. *  NOTE: There is excessive buffering here, BSYNZ and DEEMP should be
  8. *        changed to operate on variable positions within SOUT.  Also,
  9. *        the output length parameter is bogus, and PITSYN should be
  10. *        rewritten to allow a constant frame length output
  11. */
  12.  
  13. #include "config.ch"
  14. #include "lpcdefs.h"
  15. #include "contrl.ch"
  16.  
  17. extern int ipiti[11], ivuv[11];
  18. extern float rci[MAXORD][11], rmsi[11], pc[MAXORD];
  19. extern float exc[MAXPIT+MAXORD], exc2[MAXPIT+MAXORD], noise[MAXPIT+MAXORD];
  20.  
  21. synths(voice, pitch, rms, rc, speech, k )
  22. int voice[], *pitch;
  23. float  rc[], *rms;  
  24. float speech[];
  25. int *k;
  26. {
  27. int i, j, nout;
  28. float ratio, g2pass;
  29. static float sout[MAXFRM];
  30. float gprime=0.7;
  31.  
  32.  
  33. *pitch = mmax(mmin(*pitch,156),20);
  34. for (i = 1; i<=ORDER;i++)
  35.   rc[i] = mmax(mmin(rc[i],.99),-.99);
  36.  
  37. *k = 0;
  38. pitsyn(voice, pitch, rms, rc, ivuv-1, ipiti-1, rmsi-1, rci, &nout, &ratio );
  39.  
  40. if(nout>0) {
  41.     for(j=0;j<nout;j++)    {
  42.       irc2pc( rci, pc, gprime, &g2pass, j);
  43.     
  44.       bsynz(pc, ipiti[j], ivuv[j], sout, rmsi[j], ratio, g2pass);
  45.         
  46.       deemp0( sout-1, ipiti[j] );
  47.       for(i=1;i<=ipiti[j];i++)    {
  48.             (*k)++;
  49.             speech[*k] = sout[i-1]* 0.000244140625;
  50.       }
  51.     }
  52. }
  53.  
  54.  
  55.  
  56. }
  57.